<template>
    <div>
  <el-breadcrumb separator="/" replace=true>
  <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
  <el-breadcrumb-item :to="{ path: '/cmmg' }">商品分类</el-breadcrumb-item>

</el-breadcrumb>
 <el-button plain @click="addDialog">添加</el-button>
<classifylist @edit='edit'/>
<v-dialog :diaInfo='diaInfo' @cancel='cancel' ref='diaInfo'/>
    </div>
</template>

<script>
import classifylist from './classifylist.vue'
import vDialog from './dialog.vue'

export default {
  // 菜单管理
  data () {
    return {
      diaInfo: {
        isShow: false,
        isAdd: true
      }
    }
  },
  methods: {
    addDialog () {
      this.diaInfo.isShow = true
      this.diaInfo.isAdd = true
    },
    cancel (e) {
      this.diaInfo.isShow = e
    },
    edit (e) {
      this.diaInfo.isShow = false
      this.diaInfo.isAdd = false
      this.$refs.diaInfo.lookup(e)
    }
  },
  components: {
    classifylist, vDialog
  }
}
</script>

<style scoped>
.el-button{
  margin-top: 20px;
  /* border: 1px solid #b3d8ff;
  background-color: #ecf5ff;
  color: #409eff; */
}
</style>
